<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>词多多代理商平台</title>
    <include file="Index:header" />
     <script type="text/javascript">
        $(function(){
            $(".help-side dl dd:eq(0)").addClass('cur');
            $("#top #topcon .nav li:eq(1)").addClass('cur');
        })
    </script>
    <script src="__PUBLIC__/js/main.js" type="text/javascript" charset="UTF-8"></script>
</head>
<body>
<include file="Index:top"/>
<div id="main" style="overflow:visible;">
   <include file="User:left"/>
    <div id="main_right" class="container">
        <div class="title">客户列表</div>
        <div id="infotab" class="container mt10">
            <ul class="tb cl">
            <if condition="$status neq 'expired'">
                 <li class="a">
                    <a href="{:U('User/userlist')}">所有客户</a>
                </li>
                <li>
                <a href="{:U('User/userlist',array('status'=>'expired'))}">即将到期客户</a>
                </li>
                <else/>
                 <li>
                    <a href="{:U('User/userlist')}">所有客户</a>
                </li>
                <li class="a">
                <a href="{:U('User/userlist',array('status'=>'expired'))}">即将到期客户</a>
                </li>
            </if>
               
            </ul>
        <div id="seach" class="container p10 mr10 ml10">
            <table class="table">
                <tr>
                    <td  style="padding-left:30px;">
                        <div id="useroption" class="dropdown" tabIndex="1">
                            <select id="otn" style="width:120px;">
                                <option value="">选择查询条件</option>
                                <option value="userName">用户名</option>
                                <option value="realName">真实姓名</option>
                                <option value="company">公司名称</option>
                            </select>
                        </div>
                    </td>
                    <td>
                        <span style="margin-left:30px;">请输入查询内容</span>
                        <input type="text"  id="content" class="input" style="margin-left:10px;"/>
                    </td>
                    <td style="padding-left:30px;">
                        <button class="button_s green" id="btn" onclick="query();">查询</button>
                    </td>
                </tr>
            </table>
        </div>

            <table class="table" width="100%" cellpadding="4">
                <tr style="border-bottom: 2px solid #eee;">
                    <th>用户名</th>
                    <th>真实姓名</th>
                    <th>公司名称</th>
                    <th>站点</th>
                    <th>关键词</th>
                    <th>状态</th>
                    <th>余额</th>
                    <th>操作</th>
                </tr>
                <tbody id="tbody">
               <volist name="list" id="vo">
               <tr>
                    <td>{$vo['Username']}</td>
                    <td>{$vo['Realname']}</td>
                    <td>{$vo['Company']}</td>
                    <td>{$vo['sitenum']}</td>
                    <td>{$vo['keywordnum']}</td>
                    <if condition="$vo['Active'] eq 1"><td id="start">开启</td>
                        <else/><td id="stop">停用</td>
                    </if>
                    <td>{$vo['Usermoney']}</td>
                    <td>
                        <div class="menubox"  style="width:120px;">
                            <div class="mainmenu">
                                <div class="category">
                                    <span class="tit" style="text-align:center;">操作选项</span>
                                    <ul class="submenu"  style="width:120px;">
                                        <li>
                                            <a href="__URL__/userdetail/userId/{$vo['Id']}">
                                                <span class='ico ico_user'></span>
                                                客户详情
                                            </a>
                                        </li>
                                        <li>
                                            <a href="__URL__/useredit/userId/{$vo['Id']}">
                                                <span class='ico ico_application_edit'></span>
                                                资料设置
                                            </a>
                                        </li>
                                        <li style="width:120px;">
                                            <a href="__APP__/Consumption/userconsumptionlist/userId/{$vo['Id']}">
                                                <span class='ico ico_coins'></span>
                                                消费统计
                                            </a>
                                        </li>
                                        <li>
                                            <a href="__URL__/usersite/userId/{$vo['Id']}">
                                                <span class='ico ico_world'></span>
                                                客户网站
                                            </a>
                                        </li>
                                        <li>
                                            <a href="__URL__/userrecharge/userId/{$vo['Id']}">
                                                <span class="ico ico_money_yen"></span>
                                                客户续费
                                            </a>
                                        </li>
                                       <!-- <if condition="$vo['Usertype'] eq 0">
                                            <li>
                                                <a href="__URL__/tojingzhunci/userId/{$vo['Id']}" style="width:120px;">
                                                    <span class="ico ico_text_allcaps"></span>
                                                    转为精准词客户
                                                </a>
                                            </li>
                                        </if>-->
                                        <if condition="$vo['Usertype'] eq 1">
                                            <li>
                                                <a href="__URL__/jingzhunci/userId/{$vo['Id']}">
                                                    <span class="ico ico_text_allcaps"></span>
                                                    精准词列表
                                                </a>
                                            </li>
                                        </if>

                                        <if condition="$vo['Active'] eq 0">
                                            <li>
                                                <a href="javascript:void(0);" onclick="start({$vo['Id']});">
                                                    <span class="ico ico_lock_open"></span>
                                                    开启客户
                                                </a>
                                            </li>
                                            <else/>
                                            <li>
                                                <a href="javascript:void(0);" onclick="pause({$vo['Id']});">
                                                    <span class="ico ico_lock"></span>
                                                    暂停客户
                                                </a>
                                            </li>
                                        </if>
                                        <li>
                                            <a href="javascript:void(0);" onclick="del({$vo['Id']});">
                                                <span class="ico ico_cross"></span>
                                                删除客户
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </td>
                </tr>
               </volist>
                </tbody>
            </table>
            <div class="mt10">
                <div class="page_list">
                    <div class="p_l">
                        {$pageshow}
                    </div>
                </div>
            </div>
        </div>
        </div>
        </div>

<script type="text/javascript">

    $(function () {
        $("#useroption").sSelect();
    });
   function query(){
      otn=$("#otn").val();//按照什么条件进行查询
       if(otn==""){
           msgwarn("请选择查询条件");
           return false;
       }
      content=$("#content").val();//输入的查询内容
       if(content==""){
          msgwarn("请选择查询内容");
           return false;
       }
      window.location="__URL__/userlist?otn="+otn+"&content="+content;
   }
    function start(id){
        art.dialog({
            content: '您确定要开启吗？',
            icon: 'question',
            lock: true,
            ok: function() {
                $.ajax({
                    url:"__URL__/startuser",
                    type:"POST",
                    data:{"userId":id},
                    cache:false,
                    dataType:"json",
                    success:function(data){
                        if(data.status="true"){
                            msgok(data.Msg);
                            window.parent.location.reload();
                        }else{
                            msgwarn(data.Msg);
                        }
                    }
                });
            },
            cancelVal: '取消',
            cancel: true
        });
    }

    function pause(id){
        art.dialog({
            content: '您确定要暂停吗？',
            icon: 'question',
            lock: true,
            ok: function(){
                $.ajax({
                    url:"__URL__/pauseuser",
                    type:"POST",
                    data:{"userId":id},
                    cathe:false,
                    dataType:"json",
                    success:function(data){
                         if(data.status="true"){
                               msgok(data.Msg);
                               window.parent.location.reload();
                         }else{
                             msgwarn(data.Msg);
                         }
                    }
                });
            },
            cancelVal: '取消',
            cancel: true
        });
    }

    function del(id){
        art.dialog({
            content: '您确定要删除吗？',
            icon: 'question',
            lock: true,
            ok: function() {
                $.ajax({
                    url:"__URL__/userdel",
                    type:"POST",
                    data:{"userId":id},
                    cathe:false,
                    dataType:"json",
                    success:function(data){
                        if(data.status=="true"){
                            msgok(data.Msg);
                           window.parent.location.reload();
                        }else{
                            msgwarn(data.Msg);
                        }
                    }
                });
            },
            cancelVal: '取消',
            cancel: true
        });
    }
</script>
</body>
</html>